package com.wsl.config;

import com.wsl.Condition.LinuxCondition;
import com.wsl.Condition.WindowsCondition;
import com.wsl.service.ListService;
import com.wsl.service.impl.LinuxListService;
import com.wsl.service.impl.WindowsListService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

/**
 * @Author:WangShuliang
 * @Description:
 * @Date:Created in 12:16 2017/11/26
 * @Modified by:
 */
@Configuration
@ComponentScan("com.wsl")
public class ConditionConfig {
    @Bean
    @Conditional(WindowsCondition.class)
    public ListService windowsListService(){
        return new WindowsListService();
    }
    @Bean
    @Conditional(LinuxCondition.class)
    public ListService linuxListService(){
            return  new LinuxListService();
    }
}
